home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / MDSPL100.LZH / MDSP1.C < prev    next >
Text File  |  1987-11-01  |  1KB  |  37 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <stdarg.h>
  5. #include <dos.h>
  6. #include <conio.h>
  7. #include <ctype.h>
  8. #include "mdisplay.h"
  9.  /*                                                                   */
  10.  /*   This program writes to a window that consists of the left half  */
  11.  /*   of the monochrome monitor.  It is used to demonstrate the use   */
  12.  /*   of the mwin I/O routines from multiple programs.  Before this   */
  13.  /*   program has run, initialized the monochrome card with the MDSPI */
  14.  /*   utility program.                                                */
  15.  
  16.  
  17.    char         input;
  18.    int          attrb;
  19.    int          wind1;
  20.  
  21. main(argc, argv)
  22.      int    argc;
  23.      char   *argv[];
  24. {
  25.    initMwin();                        /* Initialize mwin data areas  */
  26.    wind1 = createMwin(0,0,39,24);     /* Create window, left half    */
  27.    if (wind1 == ERROR)                /* Successful?  Should be      */
  28.      { printf("Error in createMwin.  Program aborted.\n");
  29.        exit(0);  }
  30.    attrb = 3;                         /* Normal display attribute    */
  31.    input = getch();                   /* Write input until eof or ESC*/
  32.    for ( ;!eof(fileno(stdin)) & input!=27; ) /* quit on eof or ESC*/
  33.        { writeCharToMwin(wind1, input, attrb);
  34.        input = getch();
  35.        }
  36. }
  37.